<%@page import="java.util.Enumeration"%>
<%@page import="com.limetalks.data.User"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
	
	<link rel="stylesheet" type="text/css" href="css/LT.css">
	<link rel="stylesheet" type="text/css" href="css/jModal.css" />
	
	<script type="text/javascript" src="js/LT.js" ></script>
	<script  type="text/javascript" src="js/jquery-1.6.4.js"></script>
	
	<div style="background-color:#2C2C2C; width:100%; height:25px; z-index:0;">
		<div style="width:800px;">	
				<div style="color:white; padding-top:4px; text-align:center;">
				
				<div style="float:right;">
					<%  Object user = request.getSession().getAttribute("user");
						if(user == null) { %>
						<img src="images/user2.gif" width="15"/>
						<a href="javascript:showLoginForm()" class="top2" style="color:white; padding-right:30px; position:relative; top:-3px;" >Sign in</a>
					<% } else { %>
						<script type="text/javascript">setUser('<%= ((User)user).getId()%>','<%= ((User)user).getName()%>');</script>
						<a href="javascript:showUserMenu()" class="top2" style="color:white; padding-right:30px;" ><%= ((User)user).getName() %></a>
						<a href="javascript:logout()" class="top2" style="color:grey; padding-right:0px;">Logout</a>	
					<% } %>
				</div>
				<div class="top" style="float:right; font-weight:bold; margin-right:150px;">Fresh Speaking Zone</div>
			</div>
		</div>
	</div>
	
	<div style="width:800px; height:90px; z-index:500;">	
		<div id="Logo" style="text-align:center; float:left;margin-right:10px; margin-left:20px; z-index:500;">
			<a href="http://localhost:5080/LimeTalksRed5/"><img src="images/LT_logo1.gif" width="100" style="margin-top:-18px;"/></a>
		</div>
		<div id="Title" style="text-align:center; float:left;">
			<a href="http://localhost:5080/LimeTalksRed5/"><img src="images/LT_title1.gif" width="200" style="margin-top:-25px;"/></a>
		</div>
		<div class="menu">
				<a href="" style="padding-right:10px;">Home</a>
				<a href="" style="padding-right:10px;">About</a>
				<a href="" style="padding-right:10px;">Feedback</a>
				<a href="" >Contacts</a>				
		</div>
		<div style="float:right; margin-top:10px;">
			<button onclick="<% if(user != null) { %>
								{window.location='newStream'}<%  
							} else { %>{alert('Sign in to start a speech.')}<% }%>">Start speech</button>
		</div>
		
		<div style="position:absolute; visibility:hidden;">
			<form name="logoutForm" action="Logout" method="POST">					
				<a href="javascript:logout()"  style="color:white; font-size:12px; padding-left:20px;">Logout</a>
				<input type="hidden" name="loc" value="<%= request.getRequestURI() %>">
			</form>
		</div>
		
		<div id="loginForm1" class="loginForm1" style="color:#black;
													font-family:Comic Sans, sans-serif;
													font-size:12px;
													background-color:#FFFFFF; 
													z-index:9999;
													padding:5px; 
													padding-right:10px;
													border:1px solid #cccccc;
													width:200px;
													height:170px;	
													text-align:left;
													position:absolute;
													visibility:hidden;											
													border: 1px solid #cccccc;
												    
												    -moz-border-radius: 7px;
												    -webkit-border-radius: 7px;
												    border-radius: 7px; 
												 
												    /* Border Shadow */
												    -moz-box-shadow: 2px 2px 2px #cccccc;
												    -webkit-box-shadow: 2px 2px 2px #cccccc;
												    box-shadow: 2px 2px 2px #cccccc;
													">
						
										
			<form name="loginForm" action="Login" method="POST">
				<label for="login">Login</label><input type="text" name="login" id="loginText" size="24" style="padding:5px; font-size:14px;"><br>
				<label for="password">Password</label> <input type="password" name="password" size="24" style="padding:5px; font-size:14px;"><br>
				<%
				String params = "";
				if(!request.getParameterMap().isEmpty()) {
						params = "?";
					
					for(Object paramName : request.getParameterMap().keySet()) {
						if(!paramName.equals("user"))		
							params += paramName + "=" + request.getParameter(paramName.toString()) + "&";
					} 
				}%>
				<input type="hidden" name="loc" value="<%= request.getRequestURI() + params %>">
				<input type="submit" class="loginSubmitButton" value="Sign in"/>
				<!--  a href="javascript:login()"  style="color:white; font-size:12px; padding-left:20px;">Sign in</a-->
				<a href="register.jsp" style="color:#999999; font-size:12px; position:relative; top:20px; left:25px;">Register</a>
			</form>
		</div>
		
		
		
	</div>